package com.freecloud.framework.utils;

import cn.hutool.core.util.StrUtil;


public class HtmlUtil extends cn.hutool.http.HtmlUtil {

    public static String restoreEscaped(String htmlStr) {
        if(StrUtil.isBlank(htmlStr))
        {
            return htmlStr;
        }

        htmlStr = htmlStr.replaceAll("&ampamp;", "&");
        htmlStr = htmlStr.replaceAll("&amplt;", "<");
        htmlStr = htmlStr.replaceAll("&ampgt;", ">");
        htmlStr = htmlStr.replaceAll("&ampquot;", "\"");

        htmlStr = htmlStr.replaceAll("&amp;", "&");
        htmlStr = htmlStr.replaceAll("&lt;", "<");
        htmlStr = htmlStr.replaceAll("&gt;", ">");
        htmlStr = htmlStr.replaceAll("&quot;", "\"");
        return htmlStr;
    }
}
